Some map code cleanup.