Make array cast work like JSON cast.