Fix horrendous typo & regression

* Bugs introduced in I28af1c87292fedf244b53e8eb53b2f3e19469122
* This CL fixes the bug and also adds code to ensure that proper
  account flags are set on every initial sync

Change-Id: Iad6c230087cf52207b020353c0a838cd8710b628
2 files changed