Firefox XHR doesn't work

Had to make a couple small fixes to get Firefox XHR to work. Looked like typos or a result of refactoring.