Minor bug fixes.

Fixed a bug that didn't permit to create the correct output file name.