Added a shutdown hook for the local node.