Fix error typo
Layout generation fix (inf loop possible)