fixed potential segfault in Pid
more python work