Various fixes re. type variables

Fixes #75, #82 and #87 
Lines too long? Wrap at 100 or less. Not sure why checkstyle didn't complain.