Updated and corrected the Sql classes.