Fixing PHP warnings and notices.