more pdf generation and a minor fix