Fixed bugs related to logs