Add log and a few changes.