1. Fixed error in test.
2. Added invert method.