Added some checks in response xml verification to prevent crashing. Added corresponding tests.