fix variant array deserialization, add tests