Added env handling to CommandExecutor