bugfixes in error reporting