XHR test bug fixes