I've made the code changes you prescribe in the new upload also
Note that I made a small change in the setRefresh debug code to print nI as well.
What does that debug code print on the first opening of the dialog box?