Minor improvements to PHP scripts