Yes. In those cases it is fine.
I don't think it should be illegal to have unenforceable clauses. Just ones that are known to be unenforceable. For example look at your average ISP out TV provider contract and there are a handful of these designed to prey on the public that doesn't know better.
It would definitely be difficult and messy to enforce, quite likely to messy to be feasible, but I would like to see some rule like this passed.