some more array indexing fixes