Check for arrayble interface on collection toArray. Fixes #1049