Fix bug in getEnvironment() (#188)