fixes a bug saving forms after adding, then removing a row.

Adding a merged row, then removing it causes an error on save. This is because the indexes are incorrectly calculated after removing a row. That was caused by classes being applied to the wrong row types by the too broad jquery selector that I have altered in this PR.