odf: improved valid()