Fix a large number of flaws in the prior versions of these.