fixing #3302: match record type and value as well during deletion, if specified