Fix log buffering