Removed spuriously early rounding of results and fixed use of ndarray