Well then, breakpoint in the function and examine the variable values. That will let you know why you're seeing the behavior that you are.