fix variant array handling, add more tests