Fix sqldot bug and improve sqlhtml generation