Revert last commits because it causes test failures.

Will investigate later what's going on.

This reverts commit b01395c07e4e0e5e5df25624665fc71bd359f6ad.