Handle collections returned as an array

Fix for #170