Removed a few bugsin GLM and elsewhere