A small fix to avoid an infinite loop for bug #7591.