add sequence loss count export, various little fixes