Refactoring debug errors.