Better error message on index mismatch