Fixed issues caused by the refactoring.