Fixed bug in flatten related to the type information for a nested array being passed incorrectly.