minor fixes in ajax.js