Try to fix crashes

But things are still crashing a lot in account management code.
On the other hand, loading avatars don't require restarting the app, but
causes a huge lag while loading them initially. You should add a dialog
later to make user disable displaying them on initial connection.