Check for array on Collection. Fixes #1542.
Merge branch '4.0'