Added basic error handling and additional accepted metadata element.