Fix generated template haskell code for type vars