Fix inversion of if condition