Made buffer size setting more reasonable