Fixed a few bugs in SSA and type inference. It can now check itself without crashing.