private function _set(&$cfg, $args) {
        if (count($args) === 2) {
            $key = $args[count($args) - 2];
            $value = $args[count($args) - 1];
            $cfg[$key] = $value;
        } else {
            if (!is_array($cfg) || !$this->has($args[0], $cfg))
                throw new NotFoundSettingsException($args[0]);
            // Evil, but I found no other way to pass $cfg as reference via call_user_func_array.
            eval('$this->_set($cfg[$args[0]], array_slice($args, 1));');
        }
    }