I just lost a game to this same bug! :( My guess is that internally the cards are listed in a hierarchy with Ace at the top above King and the developer forgot to handle the case when Ace is the lowest card in the hierarchy sometimes.