Some changes to support the new --filter option: