Fixes for problems introduced during refactoring