Added better (but not proper) logging.