Fixed a number of bugs to as to work with reports.