Improved Code Generation on Boolean statements