It fails when the typeat goes over two lines, as in:
typat 1 1 1 1 1 1 1 1 4 2 2 2 2 2 2 2 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
It fails when the typeat goes over two lines, as in:
typat 1 1 1 1 1 1 1 1 4 2 2 2 2 2 2 2 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3