Fix issue with cloning typed arrays

Closes #624
Merge pull request #625 from d10/clonetypedarray

Fix issue with cloning typed arrays.