Check if invalid, remove double-negative comparisons.

Wrapped up in functions, but we are effectively changing
from:
if( ! (this != that) )
to:
if ( this == that ).