I'm reworking and updating my mod that hasn't been working for over 4 years (oops) and I've run into a problem. Everything works fine, except the very ending of the quest. The player returns to the quest giver and ends the quest. However, the quest item is stuck in the player's inventory and the monetary reward is never given. I have the script code entered correctly according to the Creation Kit wiki, but it doesn't work at all.
Is there something blatantly obvious that I'm just entirely missing?