Fixed PHP notices and warnings.