[fix bug 984298] Check that identifier exists before cleaning.
Merge pull request #862 from glogiotatidis/984298

[fix bug 984298] Check that identifier exists before cleaning.