Fix popen2 problem