Minor code cleanup.
Added temporary logging.