Fixed map indexing issues