fix path discovery (getenv returned None which caused exception)