Issue 641

Fixes #641 
Any particular reason for the xor? (vs. `!!`)