Added array class caching, fixed erroneous error message, and removed unnecessary assert.