alignment fix in generation when ysamples>1