Cleanup and add stacktrace