Fix bitwise operators in loops (issue #192)