Better environment id checking.