Changed the @terms and @nonterms CFG members to Sets.