Correctly implemented Shell hook/launcher termination and cleanup