Made better use of flags to simplify treatment of masculine nouns and make further improvements easier