add normalized error reporting, fix encoding problems