Arduino sketch not running startup method
When power is first applied, any values you read could be crazy, and are certainly suspect.

Are you making any decisions based on reading values in setup()? If so, it could it be that the rest of your circuit has not settled down yet, and you get interesting bugs because of it.

Try a delay() in your startup() and see if the problem goes away.