Fix some error handling and tracing issues

Fix #1315
Fix #1314
Fix #1318
problem is when this comes from the trace itself...