Fixed a bug in extract_datasets with respect to construction of the first part of the nd array to be returned