Fix log format and pthread
stuff