Fix infinite stack recursion crashes.