Flesh out test suite.
Fix small error in simplifyBoolBranch.