Fix bug in where constraints for optional parameters.