various fixes for undeclared vars