Chg: Simplify collectionscleaning.
Fix: Fix some undefined variables.
Merge pull request #529 from nZEDb/dev

Dev