Improved metadata.json detection; typo fix.