Fix a register leak and generally clean up the error-handling in the
DIF register code.