Bug in asterisk phonebook usage?

I noticed from the logs that a call earlier today had the CIDNAME the same as the number. I thought my voip provider had botched and not sent CIDNAME. But they had. I have enabled use of the asterisk phonebook on the inbound route for my DID, and found the following in the ‘cidlookup’ context.

[cidlookup]
include => cidlookup-custom
exten => cidlookup_5,1,Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})})
exten => cidlookup_5,n,Return()
exten => cidlookup_return,1,Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})})
exten => cidlookup_return,n,Return()

So, if a valid name was passed in, but the number is not in the phonebook, it will have the name stepped on. I thought I remembered older behavior being that the cidlookup code only set the CIDNAME if there was none already. The current behavior seems less than useful. Am I remembering wrong?

to track this.