Fixed bitshift simplify to handle negative shifts and avoid 32 bit overflow.