Fix if-clauses that make code to be unreachable.

Fix two cases where use of assigment operator instead of comparison
operator causes if-clauses to be always false and code to be unreachable.