Improved visualization with pdf, bugfix