Handle restart of Nanode without crashing. Fixes #50