Fix the terrible for loop in the snapshot target