Delegate response handling, fixing a couple of bugs which were causing issues with stricter servers.

Signed-off-by: Ben Corlett <bencorlett@me.com>