Output generation fixed