Fix subprocess calls
improve defaultdict conversion