Fix bugs in setting and getting state variables