Added copy of backtrace functions to fix a bug