Fixed subprocess issues