Tweaks and a few tests.