Added test on free index mismatch and more than 3 appearances of a index
in one term.