Fix bugs when parsing var_names