Fix scoped_array issue