Fixed for newer PHP version