Fixed error reporting and metadata fetching.