Variable renames, and additional debug logging.