Fix bug if only the input has only one sample.