I assumed in the past when the chip is programed the variables are allocated space within the program area and I believe that the programmer does not initialise the variables to zero so if the variable space had previously been set those values will persist. I have come across this before and I always initialise my variables to known values if required. I wonder if chips are shipped with all bits set to zero or are some set during testing in the factory or just randomly as part of the manufacturing process.

Anyway as I said I have noticed this behaviour before and I initialise my variables within the program.