improved keyword classes
give error message for invalid keyword set
minor simplification