Fix some buffering issues