Merge "Prevent bit shifting if num bits is negative"