add tests.
fix tests.