Unit Test for ReferenceArray.  Small fixes to PrimitiveArray and ReferenceArray.