Fix indexing in 2-sample edge case
Merge pull request #359 from benjjneb/patch-2

Fix indexing in 2-sample edge case