Fixed swap sampling bug.