Move default adapter instantiation in env and fix tests