Fixes a serious performance regression