Add SyncPolicyManager
Fix some bugs