[BUGFIX] Avoid PHP warnings...

If $array[$level] is NULL then array_key_exists will produce:
PHP warnings: array_key_exists() expects parameter 2 to be array, null given in