Some improvements to PDF import