Fixes to global, groups, resources and view_statistics reports. Fixed some export fucntions. Removed outdated code