Fix erroneous assignment in an if statement.