Fixes to report writing