Fixed PHP warnings in generateSnapshots() methods
Merged from 5.2