Bug fixes, new tests.