Got it

Check at the beginning of Claim/Request/Release was wrong when the
random number was bigger than the remaining. This caused the program to
exit