Test and fix for NH-3141
NH-3141 - add tests to ensure consistent behaviour with id changes