Fixed Update PHP and general code clean up