Fixes logout on internet reconnect and various errors