sql fixes
Merge branch 'master' of https://github.com/mkgobaco/lc into github-mkgobaco-lc-local/master