fix issue #28 and a few other bugs that I found along  the way

namely empty row yields unapplied style.