Actually test the new setting in the tests.
Keep the correct extension when copying files

The source file was copied to the destination even when the destination had
a different extension. Now, we change the extension of the destination back to
the extension of the source file before copying.