Fixed bug where null responses would throw an exception

Very small fix, with regression test