Fixed PDF merging and output