You have misplaced semicolons that are short-circuiting your if blocks.

In other words, it's not:


if (foo == 3);
bar;


but rather: