Merge in thread safety fix to lastest dev version