Fixed pdf report generation and other issues