Added debugging stack traces to locate bugs.