Fix array indexing errors!