Fixed serializer to work with > gcc4.7