Fixed crash in serializer