Trouble with authenticate()

I have spent some time trying to get authenticate() to work with the database. Here is my test case:

pbx*CLI> database show passcodes
/passcodes/100 : 5678
1 results found.

[authenticate_test]
exten => start,1,noop()
same => n,set(USER=100)
same => n,set(PASSCODE=${DB(passcodes/${USER})})
same => n,authenticate(${PASSCODE},4)
same => n,authenticate(/passcodes/100,d,4)

According to Asterisk-Admin-Guide-1.8.pdf, the “d” option means “Interpret the given path as database key, not a literal file” and the examples I read showed the keys with a leading slash. In the context above, the first (non-DB) authenticate() works and the second fails.

Here is example output:
== Using SIP RTP CoS mark 5
– Executing [*0@intercom:1] NoOp(“SIP/spa3102-00000260”, “”) in new stack
– Executing [*0@intercom:2] Goto(“SIP/spa3102-00000260”, “authenticate_test,start,1”) in new stack
– Goto (authenticate_test,start,1)
– Executing [start@authenticate_test:1] NoOp(“SIP/spa3102-00000260”, “”) in new stack
– Executing [start@authenticate_test:2] Set(“SIP/spa3102-00000260”, “USER=100”) in new stack
– Executing [start@authenticate_test:3] Set(“SIP/spa3102-00000260”, “PASSCODE=5678”) in new stack
– Executing [start@authenticate_test:4] Authenticate(“SIP/spa3102-00000260”, “5678,4”) in new stack
– <SIP/spa3102-00000260> Playing ‘agent-pass.gsm’ (language ‘en’)
– <SIP/spa3102-00000260> Playing ‘auth-thankyou.gsm’ (language ‘en’)
– Executing [start@authenticate_test:5] Authenticate(“SIP/spa3102-00000260”, “/passcodes/100,d,4”) in new stack
– <SIP/spa3102-00000260> Playing ‘agent-pass.gsm’ (language ‘en’)
– <SIP/spa3102-00000260> Playing ‘auth-incorrect.gsm’ (language ‘en’)
– <SIP/spa3102-00000260> Playing ‘auth-incorrect.gsm’ (language ‘en’)
– <SIP/spa3102-00000260> Playing ‘vm-goodbye.gsm’ (language ‘en’)
== Spawn extension (authenticate_test, start, 5) exited non-zero on ‘SIP/spa3102-00000260’

Note that loading the variable PASSCODE from the DB provides 5678, and I entered 5678 all four times above.

I would like to have authenticate() use the DB directly. What am I doing wrong?

Thanks!

UPDATE:
pbx*CLI> core show version
Asterisk 1.8.10.1 built by asterisk @ pbx.hodges.org on a i686 running Linux on 2012-03-22 14:39:16 UTC