Refactoring bug fix.