Continue the test cleanup and fix a couple of synchronization issues

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>