Bug correction from ndarray