Made the betaVar optimization apply in more cases.