Changed handling of child threads, closes #4