Improved error handling on Google API functions.