Fixed UTs, removed some debug code and simpliefied console logging in testbed. Still looking for the nasty race condition