fix inventory unit orphan removement
Merge pull request #1186 from fullpipe/master

[Core] Fix inventory unit orphan removement