Fixes missing last line of buffer not flushing