Fix some bugs in amalgamated syncing process #27