fixed calling set_var incorrectly on inc and dec