Some codechanges and modifications for function directory_list inside core.'