Fixed bug with invalid xml not causing error