Better logging on errors.