Corrects value type and fix bug on desearilize