Explicitly initialize n to 0 in count_saves().