Avoid undefined shift behaviour
Merge pull request #133

9048def Avoid undefined shift behaviour (Pieter Wuille)