Remove duplicate call mg_stat (use flag is_directory)