Minor sql.py cleanup
minor fixups