Fixed small bugs in SQL and conf