Improvements and bugfixes to entity damage tracking API
Now merging works properly