Handle declarations in branches properly