Improvements to tests