Stronger checking for the global ga() function