Fix race condition. #38