Rework array coercion to handle primitive types as well