fix two refactoring errors