Fixed a bug in findSampleIdsBy(), where ClassCastException is thrown