Fixed #1757 (Undefined Behavior: Shift too many bits)