Fix log bugs