Fix alternate-screen bugs introduced by move to B-trees. Alternate