Fix 'nested ifs' resolving tags and definitions too early.