Fixed stack overflow due to recursion.