Fix several mapping problems.