Improve finalterm logging and handle aborted commands explicitly in an attempt to resolve issue 3183.