Fix for some cases of negative sampling.