Fixes for 1.0.17.1

Sanity check the thread_type value in flare.xml
Fix and test for a duplicate thread id issue
ready for 1.0.17.1
Merge branch 'release-1.0.17' (1.0.17.1)