Fix index-over bug