Fixes not exiring when main thread finishes