Fix shutdown crash and remove a shitton of warnings of unused parameter in virtual functions.
Refactor CFBG code