Minor bug fix to correctly save PDF