Bug fix to sync'ing routines when using the --flatten option.