The size of the newly-constructed array is not correct. I'll fix in my branch, since I also have a number of other improvements.