Handle undefined variables properly