Fixed some compiler bugs