Fixing shutdown-function for nodes