Fix typo on lookupvar that made some conditional branches never executed