This was previously causing a segmentation fault, as the gateway response would not be valid XML to be parsed. Closes: #38, #71