Fixed major indexing bug