Fixes for 1.0.16.2

Sanity check the thread_type value in flare.xml
Fix and test for a duplicate thread id issue
ready for 1.0.16.2