Trouble with 'it' in multi-word commands

Here’s the scenario:

>GET CANDLE
You get the candle.

>X IT
It's made of wax.

>GIVE IT TO SANTA
You're not carrying any it.

>DROP IT
You drop the candle.

Why is it that ‘it’ is understood when using verb/noun input, but not when using multi-word input? By adding some debugging code, I can see that noun1 correctly converts ‘it’ to the previously used noun1 (i.e. ‘candle’) in the EXAMINE and DROP commands, but it is left as ‘it’ in the GIVE command.

Code snippet please.

You can use the code snippet here. Try:

>EXAMINE NOTE
You see nothing special.

>GIVE IT TO VENDOR
You're not carrying any it. <-- 'it' not identified

>GIVE NOTE TO VENDOR
The vendor reads the note and returns it to you.

>DROP IT
You drop the note.