Bug fixing to make alle the tests work.