The answer can be found when Moria infuses Oars' body with Luffy's shadow, in Chapter 457. Moria is the Master of Shadows; when he is talking to a shadow directly, he has complete control over them. Therefore, it is during that time that he needs to give details directives to the shadows before he infuses the shadow in the Zombie's body.
For example, if he does explicitly state that the shadow should forget everything about his past, his personality might remain with the Zombie. Note that Luffy's personality remained at first because of the size difference between the shadow's original body and Oar's.
As Dr. Hogback states, they were not always aware of those rules and therefore made some mistakes with a number of Zombies (the only confirmed case is Cindy). We can however extend that theory to other Zombies which did not necessarily obey their masters perfectly, like Lola.
(For conciseness purposes, only part of pages 4 and 5 are shown.)