Misc improvements to tests