Fix ugly buffer+flag combo

Tested - it seems to work.