Nodes shutdown support

Closes #509