Use 'namespace' key if it is present
Fix array to access