some small tweaks to php and js