Fix target file name generation