Fix error when printing undeclared variable