Fix ToRegister off-by-one error.