Fix bug in stacktrace formatter
Refactor payload generation