Merge branch 'threadsafe'