Fix a shift count overflow on 32bit box