Fixing conditional statements