Correct a few problems with the code rewrite logic
Add auto-correct support for AndOr