Fix interator prefix generation for paths with trailing slashes (like "/").