Debugged and got running again.  Pdf seems to be working.
Fixed a few more reporting bugs and made the pdf look reasonable.