Minor fixes on pdf generation