Fixed a couple of logic errors in the c++ serializers