Fixed output file naming. Unfortunately the overall issue is still present.