Added better logging.