Fixes regressions #1173 and #1174