Fixing issue #475. I've made a change a while back to fix latex, but that broke warning reporting for typed variables.
Added JUnit that tests both positive and negative cases.
Forgot to add the copyrights comment.
Merge pull request #478 from kframework/untyped-var-fix

Fixing issue #475. I've made a change a while back to fix latex,