Fixed local variable 'random_filename' referenced before assignment error when a source filename is supplied.