I'm going to say that stalemate should count as a victory, but I'll see if I can give it different text. The game tries to find if the king is in danger before picking which moves are legal, so it's coded to count situations where no moves are possible as checkmates.