Thanks to cdaulepp and loudent2 for pointing this one out:
When you are using GetGoldPieceValue() on an item to get the value, if the item is not identified the function will return 1.
See the full post here:
GetGoldPieceValue() Does it work correctly?