Fix end logging