Add named key handling to setDef
Treat setting in the middle of a range as an error