bugfixes in Gen.of_array