fix small bugs in reporting errors
changes to make more robust and working on WinXP