Ported the fix to master