Fixed a bug in SampleSelector, which selected the current sample incorrectly.