Bug fix in logging