A bunch of final touches, more unit test tweaks