Fix optimization of allbut.