Fix stack trace generation.