This reverts commit 199a0f9f5a. Fixed the left-shift of signed integer which was causing UB.
199a0f9f5a