Fix NPE on getting environment variables (fixes #431)

Sorry