fix a few bugs in sync-localstorage