fixed broken toArray for slices