fixed few deadlocks and tests seem stable now