Fix typos and total-page-count

Hi, 

when using this lib, I got onto problems with calculation the page-count in combination with a bottomtable. 

This fixed it for me. 

Any objections?