Some changes that increased the stability significantly

My local setup has two nodes in the mesh. Without these changes, the nodes would shut down every few minutes under load. Now it seems to be mostly stable.