Fixed memory leak issue after upgrading NUMPY API