Fixed buffer_size bug