Fixed a bug with SQL attributes