Optimizations in log system, local fixes