[stacktrace] Fix out of bounds panic

Fixes #29.