More race condition fixes...