Add missing scope to functions to eliminate warning in PHP 5.6.x