Fixed database issues
Merge branch 'dev/scada' of https://github.com/dkaynarc/tmc into dev/scada