Minor fixes to SQLs.