fixes for compatibility with old sklearn.