Fixes in functions check_var_set, etc...