Fix snapshot prepare logic