Improvements and fixes on tests.