Added some tests to improve coverage, fixed existing tests.