fixing minor issues in receive_xml() to avoid seg faults.