Add missing subprocess synchronization