Just some tweaks to reduce warnings and notices for uptight PHP servers.
This fixes an issue where the AJAX URI could have invalid characters inserted.