Fixes to ajax.js