Serializer fixes

This fixed #160