Cleanup and add tests, incl. breaking one