Add option for overriding the buf_size