Fixes for php and js