Add config validation tests (and a fix for an uncovered bug).