fix typo.
check if $cfg is really a hashref.