Fix misplaced logging.