Deal with primitive array types

There is a bug when a validation fails for a primitive data array.
Eg a NotNull failed validation on a byte[] caused the code to throw a ClassCastException