[BUGFIX] Fix cgl cleanup introduced bugs
Merge pull request #522 from hmspl/fix_cgl

[BUGFIX] Fix cgl cleanup introduced bugs