Added error handling for UserInfo serialization and deserialization.