clean up php notices and warnings for 5.3