Various fixes re. type variables

Fixes #75, #82 and #87 
This is the only method I'm unsure about due to limited exposure of this corner of mirrors/elements. @gk5885 should take a look.