Empty buffer at the end of flushBuffer

- Fixes #79