Fixes to ajax