fixes in sql mode
merge