Additional work on scripts/filter-locations.  Fixing bugs and improving handling.