Upgrade to latest API and enhance error reporting.