Fixing PHP notices and warnings.