Minor teaks for sql and interface