Added support for 'on clean' hooks.