better output, no errors

No longer throws errors, but still doesn't export the p/x files.
Improved output detail.  If 'i' is initially set to 15, it outputs the
p/x files just fine (but skips the detailed maps).  I just need to work
out why it seems like 'i' going above 14 ends the script...