Fixed offline issue when logging out via SessionManager, and fixed a slight bug in DbHelper