Improve error report for debug