fix some PHP notices/warnings