m/directory: Added flatten on returned array