Fix a bug in optimising division to shift right