fire error event on xhr error.
minor test cleanup