Avoid wrong bit-shifting.

Fixes Coverity issue CID#1222015