More fixes for sync script.