Handle array and map slicing and indexing properly