This reverts commit 8cd005ba43 as it seems to produce some failures in some cases. This needs more research.
8cd005ba43