Small fixes and tests.