You never described what the problem is. You say you're seeing weird values in the debugger. At what point? When do things go wrong?