Moved ReplaceNth to misc package.