fix removing entity annotations when merging (and related tests)