Final fixes for the thread creation