Fixing a few bugs with the AJAX mechanism.