Improved error messaging, updated for API changes.
Improved error messaging, updated for API changes.