Fix DMI writing, start moving to logging.