Fixed some bugs in race and concurrently