More fixes to IR types

This closes all type errors in the IR that I found in HelloWorld+Reversi+Test suite. I haven't yet tried the partest suite.