Only remove the extension when extracting basename.