[Issue #42] Added some extra checks to ensure metadata and duration is valid.