Bugfix for sign-extending numbers