T-Res: fix #11

T-Res: fix incorrect behavior of getState(). The corresponding native function now creates a new float or int object instead of changing the existing one.