Fixes regressions in previous version.