Check names of range vars and add more test cases for var declarations.