Fixes for various AJAX issues