Fixed debugging in terminate.