Correct environment test to deal with async.