Fixed a number of bugs in the compiler, for guards