Use 'not' instead of '== nil'.
Remove unneeded code from tests.