serialize: added unit test for recovery + fix