Updating SQL to remove bugs.