Changed how threads join main() to be more responsive.