Fix PHP notices that are failing tests