Fix terminating subprocess on close/exit instead of just exit.  Also clear log window on close.