Fix deprecation warning and remove logging.