Fixed various smaller bugs during sync process.