Replace some bit operations with simpler ones. No functionality change.