better error reporting in the serializer