Fix buffering problems