Changed error reporting to log.