build_db.py: Fix a bug when several parts of properties were being removed