Various small changes

Removed unneeded operation from signed_rshift function. Made a lot of
variables local.