Revert accidental map change

This reverts part of commit bda53c83e7da4776fae26ac09528d3cf3ffaf403.
Bug fixes, code cleanup