Thanks Nate! Actually I found that one of my problem was that some layers had the same name. I had a set of different options and had the same layers named the same way by in different positions, and it seems that that was a problem.
Actually strange enough I think that the fact that the script stops when empty layers, it was good for me, because it allowed me to detect empty layers that are a bug.
What I think it would be awesome is that at the end of the export, get a report that there has been empty layers, to track down errors on large documents.
just a suggestion. Thank you.
I found a possible bug on the latest version of the png export. If you have a layer that has ":" in it, the script stops. So it is not possible to use it with the "png express" plug in, since each layer that is exported by the png Express adds "PNG:" to the layer.