Added logging.
Some more renaming.