Pure implementation of 'array' type, added casts to 'array', array indexes weren't resolved correctly