Regression fixes

This fixes a few regressions introduced by my recent refactoring.