Various tweaks and more tests