Make deleting table more robust.