Added more verbose logging on errors.