Correct grammar; simplify boolean expressions