fixed stdlib references and KpGetEnvironmentVariable