Minor updates in base on_scope_exit