Fixing template haskell generation