Fixing a compile issue and code cleanup.