Fixed regressions in previous merge