Still switch to output buffer even if input empty

Fixes undefined variable errors