Report generation bug fix