Fix problems with sync