Implement missing flush method

Fixes #1