Fixes a few things with the if statements