Added logging for errors.