fixed bug with incorrect call to ndarray.size