Fix invalid instead of masked problem with limited discrete.