Fixed a bunch of compiler bugs