Improved map serialization efficiency

Also fixed boomerang errors