When you first set the pin to an output, does it start off as high, or does it start off as low?
If it starts off as high, then when you have code such as the above, will the pin be high for a few microseconds before going low?
I'm kind of new to Arduino too, but I believe you'd want to do digitalWrite( PIN_X, LOW );. I think the pin floats before you set it, so it may not be high or low.
So, what did the pin do when you tried it? High? Low?
You could also try digitalWrite before doing pinmode, maybe you can preset what the pin will do when turned into an output?
I don't know, by the way, I'm not needling. I'm curious.
C