Alternative implementation providing correct stack traces of errors