Added check to samples, instances and samples per instance