Good catch, it was an oversight - the problem is the order of the if statements.