adjustments to newer glm version.