Improve and fix some tests