Ties now avoid rests when formatting.

The tie symbol `~` will now only only appear between two notes or chords.