Fixed append-to-selection logic.