in reply to wrong value assigned

What are the "wrong" values being assigned? You're probably going to have to take a look at your data to see why it's failing.