Fix serialization for new types

Fixes https://github.com/calabash/calabash-ios/issues/529

Thanks @idcuesta for excellent bug report and description of solution.