Handle multiple array entries in flatten