Fixed a bug causing unsynced changes to be lost