fix dead code

(spotted by Coverity: CID 1109725)
fix bitwise operation

(spotted by Coverity: CID 1109722)