Fixed issue where program would not terminate with daemon threads