Fix bugs in implementation and documentation of the mapping API.