build_db.py: Small improvements