Fixes bugs #31 and #34.
Merge branch 'master' into addpoppler