Fixed some logs not being flushed