Merge changes to snapshot test from upstream.