Move some more bitwise operations in

These should "just work", but I'm pretty sure they won't :).