Run shutdown hook improvements