Fix for LT-15014 crash merging senses

* Insert before deleting to avoid undesirable side effects.
* Add unit test for this case.
* Cleaned up old test case which had bad data that fell afoul
  of this change.

Change-Id: I3ccae27fcb7f7a750cb73f304e708e3c6840e7ce