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

but that broke warning reporting for typed variables.

Also, unfortunately I can't add a regression test, because ktest doesn't allow me to compare the output of kompile.