Fix secondary indexes according to @coffeemug's comments