"That seems to me to include psychopaths, though in any given case it'll be up to his lawyers and doctors to persuade the court. "
The reason this provision exists, so far as I understand, is to give judges scope so that relevant cases can be hospitalised (largely so that they can be placed into the treatment infrastructure) rather than imprisoned. Psychopaths cannot be treated by any means - or not yet, anyway. You might argue in response that hospitalisation can be used for containment rather than treatment, but I find the case for execution far more convincing in these cases. I recognise the discomfort for killing people for something that is essentially inborn nature - but I don't think our society has any reason to be ashamed of itself if it has no place for people whose inborn nature is unambiguously destructive, harmful and predatory - as applies to psychopaths who become killers.