Fix end file