In cellular automata, the update is generally synchronous. This means that the state of time t+1 needs to be calculated in a separate array using the state of the system at time t (these are called configurations). The first thing to do is to make this distinction clear in your code.
Also consider various types of asynchronous updating. Many artifacts can be due to the synchronous update (this is the case of lattice-gas cellular automata where spurious conserved quantities exist).