adapt to numpy 1.9, changes numpy.unique