Added ndindex changes that got mixed up somewhere else