tools: finish replaceExtension()