Fix snapshot trim logic