Improved the SQL abstraction layer.