Fixed bugs in sync. engine.