Fixed flush method to take optional args

Fixes #4