Some huge test fixes. Now almost all tests works.