Fix generation of output name