possible multithread issue fix
Login ok, logout not so much
CreateInsertSQL (called from BulkReplace (stats)) tries to set Id to 0 for all stats...