Fix underflow that results in infinite loop in b58enc.