Fixed a stacktrace printing bug