get stack trace right for error() calls (fix #40)