trimToPitches and deselection fixes