Fix bug if an odd number of arguments, and <5, are given.

In the above cases the function constructOutputFilename() was not
called, so no extension was added.