Fixed error in topLongestThread using str as number in higher if.