Fix returning wrong index to view.