Update to handling response closing and domain errors from the master branch.