Fixed flush bug introduced on last commit