Minor fixes and more tests.