Fix global var undefined check.