Fix a few problems with mapping.