Cleaned up the code.

This should address the rest of #335.
Because you set flushing to false in all other places. It does feel a bit odd, doesn't it? We set it to `true` in this function, but not back to false (except for this one line here, but no longer at the end of the function).