Fix config validation.

Fixes #4888