Fixing up code, tests.