Fixed bug related to previous refactoring.