Fixed more SQL errors.