Fix typo
Fix NPE when creating pdf