Fix TypeError when monitored process exits