Patch lib.pbs to add exit_code