Fix negative shift left reported by UBSan (#757)