Added parentheses around bitwise & expr in comparison, and added comment.

Use xor to do set and clear in single statement.
Commented out debugging printf