Correct SHIFT bug#2067
Replace undefined arithmetic
Detect overflow of arithmetic shift