Smaller fixes to testcase
Fix regex for determining charset in traceback

Fix #547