Corrected SQL errors.