Make sure a variable is defined before referenced.