Better local env detection