Fixed flushing functionality.