Fix some log bugs