Xhr bugfix 16000 - take two..

Just another attempt, if you like this style better.. didn't find you on IRC to discuss.