Fixes for ajax and pre-redirect.