Fixed all the PHP notice and warning messages I could find.