Improve collect.py memory usage

Use the copy=False option to numpy.ndarray.astype() to operate in place and return the original array rather than a copy (and catch the exception thrown by old versions of Numpy that do not have the option).