Merging changes to subproccess handling