Made PHP fixes specified by Chris for OS X