Improve stack trace handler.