Added lots of extra logging.