Updated and fixed several php scripts