Fixed SQL logging
Merge branch 'develop'