Fixed some fundamental circular retains and fundamental use after free.