Add decrefs at end of function and return None object
Fix memory leaks and inc dtype refs