Fix a couple annoying sign-extension bugs.