Fix storage allocation bug in list.take function.