Fixes Issue 2402

An attempt to fix https://github.com/scikit-learn/scikit-learn/issues/2402