Fixed boolean logic in isGuessValid()