Refs #47: get pid before killing and monitor process frequently
Merge branch 'gh47' into yan