Setup detection of environments correctly.