Fixed errors raised from deep recursion.