Fix array_keys for $extension