Fix invalid next() invocation in filename resolver.