Put recursion_guard in a more sensible place.