Lot of fixes to tests