Fixed memory corruption in metadata extraction, improved command-line directory scanning.