Fix scroll buffer issues