Fixing newline problems with sync script