Fix process exit