Fixes several issues with the recent refactoring.