Changes to AJAX handling