Bugfixes for GLM