Fix selecting thread by ID