Added more logging with stack traces.