Fixed if statements, negation. Added tests.

If statements now work correctly.