Prevent stack overflows from infinite recursion