[fix] Various bugfixes in sync mechanism.