print exactly what is in value, in hex, every character... there is probably some hard to see difference.
you can also check the error code status to see if the reg-get-value thing failed. if it fails, it may leave the old value in memory... seems like an odd thing to happen since you clear it with {} though. I don't see a code problem at all. Are you running it, then changing registry, then running again? Any chance something was cached or something didn't register the change..?