Add and fix tests.