php fixes part 1 of 2