A lot of code *and* a broken test that needs to be fixed.
Behaviour is good enough for now.