Add equal operators and more non-null checks.