A bit of cleanup, a few tests