Changed ajax calls and some other tweaks