Fixed bug in set_var()