Glm maint #1734 rebased

identical to #1734 except rebased and resolved merge conflicts.

see 1734 for description and links to related issues, partially closed
closes #1728