fixed various issues related to error reporting