Fix test failures caused by incomplete stubbing of XMLHttpRequest.