Thanks Abhijeet Viswa for the report and initial patch. Backport of 0107e3d1058f653f66032f7fd3a0bd61e96bf782 from master