Cleanup and tigher check for existence of li