Initial PDF report support and various bug fixes