Avoid shift overflow.