Fixed variable set bug