Fix nullptr and concurrentexception