Make sure contacts' chat statuses are saved to localStorage.

Also two bugfixes.