[SQL] Minor fixes.