fix value deserialization (finally closes issues #6, #7)