Improve type error stack trace