Working out regression bugs from the refactoring