Minor bug fixes in main script related to snapshotting