Fix repacking of nested arrays on output