Fixed some query-heavy things in the report controller.