Changes to pdf and some fixes