Fixed a error in the code for the SQL interface.