Fix block offsetting.

Resulted in an always-true half of a conditional since the block could
never be nullptr.
Replace shift instructions with templated function.

Ensures the same code doesn't appear twice.