Fixed bug for serializer not handling badly formed XML