History support, some optimizations
Fixed SQL error
Fixed SQL error (in ClientMonitor.update_data)
Query case optimization