Fixed NPE in getenv()