Fixed recursion bug.