Added testing option to force use untyped arrays
Optimized chunks flatten