Fixed cache busting bug in AJAX calls

Fix for problem reported in #3556.