Corrected some sql
Merge branch 'newdev' of github.com:k-int/KBPlus into newdev