Fixed buffer handling -- data now copied.