Fix an incorrect evaluation of scalar threshold expressions in numpy