Typo, returning 0, not "ret", don't lose the return value on failure.
Typo, calling log_print_err() with the wrong return error value.
Typo, verify_checkpoint wasn't returning the final error status.
Typo, final return value was being lost on failure.
Add a check for a return(0) after an error lable.