Minor sql.py cleanup