Some corrections to the xmlhttp code

In my last commit, I forgot to convert one call to $templates->get.
And after the conversion, the global variables needed an update.