Fix small logic bug in snapshot pruning