Fixed bug in refactor.