Apply UB constraints only on the relevant Phi branches

This patch fixes the unsoundness issue #13.