Added forgotten free(doc->els).