Types seem to work correctly now except for 2 things -- operators and template parameters. I haven't worked out how to solve those two problems yet...