Fixes some issues with the initial state of a thread