Invalid comparison mistaken for value assignment