fixed alternative identifier serialization/deserialization and added a test for it