Fixing warnings in js.php, removing fk restraints causing deletes to fail