Bug fixed in logging logic.