fixed flaw in logsflat/logstall when used with sort