Do not call validate_config() if it does not exist.

In addition, fixed a bug in the way function existence is checked.
test: observer sub existence not checked correctly
Fixed bug: correctly check observer sub.