Fix bit shifting arithmetic so the code actually does what the last commit message...