Fix a few issues that can unintentionally cause the router to reboot as networks are modified.