Remove debug print and redundant checks.