Fixed regression from fixes applied to #3044
Merge branch 'issue/3044'