fix serialization type cast when value is already unserialized
add test for 9041454def79d8e61cabe49e7c5cb72cef29138b
just construct real objects rather than mock and stub