Fixed regression in previous commit: The flushBuffer() function was broken.
Tweaked build script.