Fixing destructor problems
Fixing trail history SQL data history dumping