Fixed the error "dataSets[[1]]: subscript out of bounds", which was triggered by an empty result of dir() due to missing dot in '.*' regex part.