Fix 2 bugs about sync