Updated and added more logging.