Fixed a bug with snapshot.