Unasked suggestion: when switching, write the new one, then remove the old one. Then if something messes up inbetween, you can just look for containers with x>1 tokens, and remove the unplayable one. Think of it as the equiv of writing a file fully before deleting the original when moving - you don't want the only copy to be floating in the aether of volatile memory, or in FO3's case, of a sequence of instructions or a script variable.