[BUGFIX] global BE_USER was not set for removal of unrefenced
[BUGFIX] some unreferenced elements were not deleted
Merge branch 'bugfix_delete_unreferenced'